class ShareData {
  String nickname;
  int level;
  ShareData({required this.nickname, required this.level});
  // 规定对象相等的规则，如下userName属性值一样则认为两个对象相等
  @override
  bool operator ==(Object o) {
    if (identical(this, o)) return true;
    return o is ShareData && o.nickname == nickname;
  }

  void setNickname(String nickname) {
    print("set: $nickname");
    this.nickname = nickname;
  }
}
